package com.example.jpetstoreclient.domain;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
@Data
@TableName(value = "address", autoResultMap = true)
public class Address {

    @TableId(value = "address_id",type = IdType.AUTO)
    private Integer address_id;

    @NotBlank(message = "地址不能为空")
    @TableField(value = "address")
    private String address;

    @TableField(value = "user_id")
    private Integer user_id;

    public Address(Integer address_id,String address, Integer user_id) {
        this.user_id = user_id;
        this.address = address;
        this.address_id = address_id;
    }

    public Address(Integer user_id, String address) {
        this.user_id = user_id;
        this.address = address;
    }

    public Address(){
    }


    //如果添加无参构造方法则将有问题,添加autoResultMap = true解决



}
